CREATE SEQUENCE seq_pessoa START WITH 1 INCREMENT BY 1;
/

CREATE SEQUENCE seq_posto START WITH 1 INCREMENT BY 1;
/

CREATE SEQUENCE seq_resultado START WITH 1 INCREMENT BY 1;
/

CREATE SEQUENCE seq_amostra START WITH 1 INCREMENT BY 1;
/

CREATE SEQUENCE seq_central START WITH 1 INCREMENT BY 1;
/

CREATE OR REPLACE TRIGGER seq_esp_trigger BEFORE INSERT ON tb_especialista FOR EACH ROW
BEGIN
    SELECT seq_pessoa.NEXTVAL INTO :NEW.id FROM DUAL;
END;
/

CREATE OR REPLACE TRIGGER seq_enf_trigger BEFORE INSERT ON tb_enfermeira FOR EACH ROW
BEGIN
    SELECT seq_pessoa.NEXTVAL INTO :NEW.id FROM DUAL;
END;
/

CREATE OR REPLACE TRIGGER seq_pac_trigger BEFORE INSERT ON tb_paciente FOR EACH ROW
BEGIN
    SELECT seq_pessoa.NEXTVAL INTO :NEW.id FROM DUAL;
END;
/

CREATE OR REPLACE TRIGGER seq_result_trigger BEFORE INSERT ON tb_resultado FOR EACH ROW
BEGIN
    SELECT seq_resultado.NEXTVAL INTO :NEW.id FROM DUAL;
END;
/

CREATE OR REPLACE TRIGGER seq_posto_trigger BEFORE INSERT ON tb_posto FOR EACH ROW
BEGIN
    SELECT seq_posto.NEXTVAL INTO :NEW.id FROM DUAL;
END;
/

CREATE OR REPLACE TRIGGER seq_amostra_trigger BEFORE INSERT ON tb_amostra FOR EACH ROW
BEGIN
    SELECT seq_amostra.NEXTVAL INTO :NEW.id FROM DUAL;
END;
/

CREATE OR REPLACE TRIGGER seq_central_trigger BEFORE INSERT ON tb_central FOR EACH ROW
BEGIN
    SELECT seq_central.NEXTVAL INTO :NEW.id FROM DUAL;
END;
/